<template>
  <div id="app">
    <mt-header title="demo">
      <router-link to="/" slot="left">
        <mt-button icon="back">返回</mt-button>
      </router-link>

    </mt-header>
    <transition class="animated rotate" >
      <router-view class="views"></router-view>
    </transition>


    <mt-tabbar v-model="selected">
      <mt-tab-item id="home">
        <img slot="icon" src="./assets/logo.png">
        首页
      </mt-tab-item>
      <mt-tab-item id="vip">
        <img slot="icon" src="./assets/logo.png">
        我的
      </mt-tab-item>
      <mt-tab-item id="shopcart">
        <img slot="icon" src="./assets/logo.png">
        购物车
      </mt-tab-item>
      <mt-tab-item id="search">
        <img slot="icon" src="./assets/logo.png">
        新闻
      </mt-tab-item>
    </mt-tabbar>
  </div>
</template>

<script>
export default {
  name: 'App',
  data(){
    return{
      selected:''
    }
  },
  watch:{
    selected:function(newv,oldv){

      this.$router.push({name:this.selected})
    }
  }
}
</script>
<style lang="less">


@import './assets/animate.css';
*{
  margin:0;
  padding: 0;
}
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
}
.mint-header{
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 99;
}
.mint-tabbar{
  width: 100%;
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 99;
}
.views{
  padding: 40px 0px 55px 0px;
  width: 100%;
  /* background-color: #ccc; */
  height:100%
}
.v-enter {
  opacity: 0;
  transform: translateX(100%);
}

.v-leave-to {
  opacity: 0;
  transform: translateX(-100%);
  position: absolute;
}

.v-enter-active,
.v-leave-active {
  transition: all 0.5s ease;
}

</style>
